<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>opennars: nars.storage.Bag.toString</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtreedata.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/searchdata.js"></script>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">opennars
   &#160;<span id="projectnumber">1.5.5</span>
   </div>
   <div id="projectbrief">1.5-ish</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="../../namespaces.html"><span>Packages</span></a></li>
      <li><a href="../../annotated.html"><span>Classes</span></a></li>
      <li><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('d9/d37/classnars_1_1storage_1_1Bag_a4106abcc906c5ae1ce6828b0a88a1cca.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="contents">
<a class="anchor" id="a4106abcc906c5ae1ce6828b0a88a1cca"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">String <a class="el" href="../../d9/d37/classnars_1_1storage_1_1Bag.html">nars.storage.Bag</a>&lt; Type extends <a class="el" href="../../d1/dd1/classnars_1_1entity_1_1Item.html">Item</a> &gt;.toString </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Collect <a class="el" href="../../d9/d37/classnars_1_1storage_1_1Bag.html" title="A Bag is a storage with a constant capacity and maintains an internal priority distribution for retri...">Bag</a> content into a String for display. </p>

<p>Definition at line <a class="el" href="../../d6/dce/Bag_8java_source.html#l00343">343</a> of file <a class="el" href="../../d6/dce/Bag_8java_source.html">Bag.java</a>.</p>

<p>Referenced by <a class="el" href="../../d6/dce/Bag_8java_source.html#l00303">nars.storage.Bag&lt; Concept &gt;.addBagObserver()</a>, <a class="el" href="../../d6/dce/Bag_8java_source.html#l00315">nars.storage.Bag&lt; Concept &gt;.play()</a>, and <a class="el" href="../../d6/dce/Bag_8java_source.html#l00332">nars.storage.Bag&lt; Concept &gt;.refresh()</a>.</p>
<div class="fragment"><div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;                             {</div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;        StringBuffer buf = <span class="keyword">new</span> StringBuffer(<span class="stringliteral">&quot; &quot;</span>);</div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;<span class="comment">//        int showLevel = window == null ? 1 : window.showLevel();</span></div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;        <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = <a class="code" href="../../d9/d37/classnars_1_1storage_1_1Bag_a8fe5fd4141c8dbd2d6a143e3db9f3aec.html#a8fe5fd4141c8dbd2d6a143e3db9f3aec">TOTAL_LEVEL</a>; i &gt;= <a class="code" href="../../d9/d37/classnars_1_1storage_1_1Bag_a8bd35d28d93ef17c7c1d1dbbea46abd1.html#a8bd35d28d93ef17c7c1d1dbbea46abd1">showLevel</a> ; i--) {</div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;            <span class="keywordflow">if</span> (!<a class="code" href="../../d9/d37/classnars_1_1storage_1_1Bag_ae88c5d2e49a385154e243a0f55f1dae6.html#ae88c5d2e49a385154e243a0f55f1dae6">emptyLevel</a>(i - 1)) {</div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160;                buf = buf.append(<span class="stringliteral">&quot;\n --- Level &quot;</span> + i + <span class="stringliteral">&quot;:\n &quot;</span>);</div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;                <span class="keywordflow">for</span> (<span class="keywordtype">int</span> j = 0; j &lt; <a class="code" href="../../d9/d37/classnars_1_1storage_1_1Bag_ac786087fac1ddca1d938c705ccc814b9.html#ac786087fac1ddca1d938c705ccc814b9">itemTable</a>.get(i - 1).size(); j++) {</div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;                    buf = buf.append(<a class="code" href="../../d9/d37/classnars_1_1storage_1_1Bag_ac786087fac1ddca1d938c705ccc814b9.html#ac786087fac1ddca1d938c705ccc814b9">itemTable</a>.get(i - 1).get(j).toStringBrief() + <span class="stringliteral">&quot;\n &quot;</span>);</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;                }</div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160;            }</div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;        }</div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;        <span class="keywordflow">return</span> buf.toString();</div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;    }</div>
<div class="ttc" id="classnars_1_1storage_1_1Bag_ae88c5d2e49a385154e243a0f55f1dae6_html_ae88c5d2e49a385154e243a0f55f1dae6"><div class="ttname"><a href="../../d9/d37/classnars_1_1storage_1_1Bag_ae88c5d2e49a385154e243a0f55f1dae6.html#ae88c5d2e49a385154e243a0f55f1dae6">nars.storage.Bag.emptyLevel</a></div><div class="ttdeci">boolean emptyLevel(int n)</div><div class="ttdoc">Check whether a level is empty. </div><div class="ttdef"><b>Definition:</b> <a href="../../d6/dce/Bag_8java_source.html#l00230">Bag.java:230</a></div></div>
<div class="ttc" id="classnars_1_1storage_1_1Bag_ac786087fac1ddca1d938c705ccc814b9_html_ac786087fac1ddca1d938c705ccc814b9"><div class="ttname"><a href="../../d9/d37/classnars_1_1storage_1_1Bag_ac786087fac1ddca1d938c705ccc814b9.html#ac786087fac1ddca1d938c705ccc814b9">nars.storage.Bag.itemTable</a></div><div class="ttdeci">List&lt; ArrayList&lt; Type &gt; &gt; itemTable</div><div class="ttdoc">array of lists of items, for items on different level </div><div class="ttdef"><b>Definition:</b> <a href="../../d6/dce/Bag_8java_source.html#l00057">Bag.java:57</a></div></div>
<div class="ttc" id="classnars_1_1storage_1_1Bag_a8fe5fd4141c8dbd2d6a143e3db9f3aec_html_a8fe5fd4141c8dbd2d6a143e3db9f3aec"><div class="ttname"><a href="../../d9/d37/classnars_1_1storage_1_1Bag_a8fe5fd4141c8dbd2d6a143e3db9f3aec.html#a8fe5fd4141c8dbd2d6a143e3db9f3aec">nars.storage.Bag.TOTAL_LEVEL</a></div><div class="ttdeci">static final int TOTAL_LEVEL</div><div class="ttdoc">priority levels </div><div class="ttdef"><b>Definition:</b> <a href="../../d6/dce/Bag_8java_source.html#l00044">Bag.java:44</a></div></div>
<div class="ttc" id="classnars_1_1storage_1_1Bag_a8bd35d28d93ef17c7c1d1dbbea46abd1_html_a8bd35d28d93ef17c7c1d1dbbea46abd1"><div class="ttname"><a href="../../d9/d37/classnars_1_1storage_1_1Bag_a8bd35d28d93ef17c7c1d1dbbea46abd1.html#a8bd35d28d93ef17c7c1d1dbbea46abd1">nars.storage.Bag.showLevel</a></div><div class="ttdeci">int showLevel</div><div class="ttdoc">The lowest display level. </div><div class="ttdef"><b>Definition:</b> <a href="../../d6/dce/Bag_8java_source.html#l00078">Bag.java:78</a></div></div>
</div><!-- fragment -->
<p><div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
  <img id="dynsection-0-trigger" src="../../closed.png" alt="+"/> Here is the caller graph for this function:</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><iframe scrolling="no" frameborder="0" src="../../d9/d37/classnars_1_1storage_1_1Bag_a4106abcc906c5ae1ce6828b0a88a1cca_a4106abcc906c5ae1ce6828b0a88a1cca_icgraph.svg" width="412" height="183"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
</div>
</div>
</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="../../d7/d81/namespacenars.html">nars</a></li><li class="navelem"><a class="el" href="../../de/ddc/namespacenars_1_1storage.html">storage</a></li><li class="navelem"><a class="el" href="../../d9/d37/classnars_1_1storage_1_1Bag.html">Bag</a></li>
    <li class="footer">Generated on Sun Jan 10 2016 18:03:59 for opennars by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.9.1 </li>
  </ul>
</div>
</body>
</html>
